<script setup lang="ts">
import { ref } from "vue";
import { personalized, newSong, getHomeBanner } from "@/api/home";
import { useHomeStore } from "@/stores/home/home";

const count = ref([]);

personalized().then((res: any) => {
  count.value = res.result;
});

const lists = ref([]);
newSong(10).then((res: any) => {
  lists.value = res.result;
});

// const el = (document.body.style.backgroundColor = '#fff');
// 更改主题颜色;
// const el = document.documentElement;

// getComputedStyle(el).getPropertyValue(`--el-color-primary`);

// el.style.setProperty('--el-color-primary', 'red');

const banner: any = ref([]);
getHomeBanner().then((res: any) => {
  banner.value = res.banners;
});

const homeStore: any = useHomeStore();
</script>

<template>
  <div>
    <home-banner :banner="banner"></home-banner>
    <accordion :accordionList="count" title="推荐歌单"></accordion>
    <card :card-list="lists" title="新歌首发"></card>
  </div>
</template>

<style scoped lang="scss">
.el-carousel__item h3 {
  color: #475669;
  opacity: 0.75;
  line-height: 200px;
  margin: 0;
  text-align: center;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
</style>
